package com.example.finalapplication;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.NonNull;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MyAdapter extends ArrayAdapter {
    private static final String TAG = "MyAdapter";

    public MyAdapter(@NonNull Context context, int resource, List<String> list) {
        super(context, resource,list);
    }

    @NonNull
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View itemView = convertView;
        if(itemView == null){
            itemView = LayoutInflater.from(getContext()).inflate(R.layout.grid_item,parent,false);
        }

        List<String> list1 =  new ArrayList<>();
//        HashMap<String,String> map = (HashMap< String,String>) getItem(position);
//        TextView title = (TextView) itemView.findViewById(R.id.title);
        TextView detail = itemView.findViewById(R.id.detail);

//        title.setText("Title:" + map.get("ItemTitle"));
        detail.setText("detail:" + list1);

        return itemView;
    }

}
